import { getDataList, getDataDictList, dictDelete, dictEdit } from '@/api/dataDictionary/index'

import { ref, reactive } from 'vue'
interface User {
  dictName: string
  dictCode: string
  description: string
}
export const tableData = ref<User[]>([
  {
    dictName: '',
    dictCode: '',
    description: ''
  }
])
interface sendDataType {
  _t: number | string
  column: string
  order: string
  field: string
  pageNo: number
  pageSize: number
  dictName: string
  dictCode: string
}

export const sendDataList = reactive<sendDataType>({
  _t: 1680253486,
  column: 'createTime',
  order: 'desc',
  field: 'id,,,dictName,dictCode,description,action',
  pageNo: 1,
  pageSize: 10,
  dictName: '',
  dictCode: ''
})

//侧边栏列表
interface sendDataDictType {
  _t: number | string
  field: string
  pageNo: number
  pageSize: number
  dictId: number | string
  itemText?: string
  status?: number | string
}
export const sendDataDictList = reactive<sendDataDictType>({
  _t: 1680253486,
  field: 'id,,,dictName,dictCode,description,action',
  pageNo: 1,
  pageSize: 10,
  dictId: '1640899592926142466',
  itemText: '',
  status: ''
})

// 检测输入特殊字符
export const checkVal = (obj, val) => {
  obj[val] = obj[val].replace(/[^\u4e00-\u9fa5a-zA-Z0-9\w]/g, '').trim()
}
